package com.yunhe.policyfulfillment.policyful.service;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.policyfulfillment.policyful.domain.PolicyInfoNews;
import com.yunhe.policyfulfillment.policyful.model.NewStauts;
import com.yunhe.policyfulfillment.policyful.model.PolicyInfoNewsQueryCondition;
import com.yunhe.policyfulfillment.policyful.model.PortalNewQueryCondition;
import com.yunhe.policyfulfillment.policyful.model.PublishStatus;

import java.util.List;

/**
 * @ClassName PolicyInfoNewsService
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/23 16:48
 * @Version 1.0
 **/
public interface PolicyInfoNewsService {
    int createPolicyInfoNews(PolicyInfoNews policyInfoNews) throws ArgumentErrorException;

    int deletePolicyInfoNewsById(long id);

    int updatePolicyInfoNews(PolicyInfoNews policyInfoNews);

    PolicyInfoNews findPolicyInfoNewsById(long id);

    PageResult findPolicyInfoNewsByQueryCondition(PolicyInfoNewsQueryCondition policyInfoNewsQueryCondition) throws ArgumentErrorException;

    void setTop(long id);

    void setHot(NewStauts newStauts) throws ArgumentErrorException;

    void setNew(NewStauts newStauts) throws ArgumentErrorException;

    void setPublishStatus(PublishStatus publishStatus);

    /**
     * 查询5条热门新闻
     * @return
     */
    List<PolicyInfoNews> findHotNew();

    /**
     * 查询通知公告
     * @param title
     * @return
     */
    List<PolicyInfoNews> findNewByTitle(String title);

    PageResult findNewByCondition(PortalNewQueryCondition portalNewQueryCondition);

    /**
     * 定时发布新闻
     */
    void publishTimedNew();

}
